import {defineComponent} from "vue";
import {useAxios} from "ahooks-vue";
import AddDynamicForm from "../../jlstarter/fn-components/ant/form/AddDynamicForm.tsx";

import formFields from "../../jlstarter/fn-components/ant/form/mock-data.ts";
import {ChatDTO} from "../../api/model/static";
import service from "../../utils/api.ts";

let person = {
    username: "zhangsan",
    description: 20
};

// 调用 chat 方法的示例
const chatOptions: ChatDTO = {
    chatDTO: {
        modelName: 'yourModelName',
        prompt: 'yourPrompt',
        sessionId: 'yourSessionId',
        // 其他属性根据实际需求设置
    },
    body: {
        file: [/* 您的文件数组，如果有 */]
    }
};
export default defineComponent({
    props: {},
    setup() {
        let config = {modelName: 'yourModelName'};

        // const {
        //     data,
        //     loading,
        //     error
        // } = useAxios('/getFormFields');
        //
        //

        const {data} = useAxios(service.apiPrefix + '/getFormFields', service);

        return () => {
            return (
                <div>
                    <AddDynamicForm
                        v-model={data}
                        fields={formFields}
                        // fields={data.value.data.data}
                    />
                    {data}
                </div>
            );
        }
    },
});